<!--
 /**
 * Author: hongChengHao
 * Date: 2022-07-26 19:41
 * Desc: 添加观影人
 */
-->
<template>
  <yy-page class="customer-add">
    <view class="customer-add__title">基本信息</view>
    <view class="customer-add__content">
      <view class="flex-s-m fs32 pt20 pb20">
        <text class="ml30">姓名</text>
        <u-input class="tt-input" v-model="form.realName" type="text" placeholder="请输入真实姓名,与证件姓名一致" :border="false" clearable />
      </view>
      <u-line></u-line>
      <view class="flex-s-m fs32 pt20 pb20">
        <text class="ml30">身份证号码</text>
        <u-input class="tt-input" v-model="form.idCardNo" type="text" placeholder="用于进场身份核验,请正确填写" :border="false" clearable />
      </view>
    </view>
    <view class="customer-add__btn-save" @click="saveRealName">保存</view>
  </yy-page>
</template>
<script>
  export default {
    name: 'customer-add',
    data() {
      return {
        form: {
          idCardNo: '',
          realName: ''
        }
      }
    },
    onLoad() {
      // this.getRealNameList()
    },
    methods: {
      saveRealName() {
        console.log('saveRealName', this.form)
        uni.$api.user
          .saveRealName(this.form)
          .then(() => {
            this.$msg.toast('操作成功!')
            setTimeout(() => {
              this.$tools.navigateTo(-1)
            }, 1000)
          })
          .catch((err) => {
            this.$msg.toast(err.data.content)
          })
      }
    }
  }
</script>
<style lang="scss" scoped>
  .customer-add {
    &__title {
      padding: 20upx;
      font-weight: bold;
      font-size: 32upx;
    }
    &__content {
      background: #fff;
    }
    &__items {
      display: flex;
      padding: 20upx 50upx;
      border-bottom: 1upx solid #eee;
    }
    &__add {
      text-align: center;
      padding: 20upx 0;
    }
    &__btn-save {
      margin: 0 auto;
      margin-top: 100upx;
      width: 90%;
      height: 100upx;
      text-align: center;
      background: $blue;
      color: #fff;
      font-size: 32upx;
      line-height: 100upx;
      border-radius: 100upx;
      text-align: center;
      height: 100rpx;
      line-height: 100rpx;
      background: linear-gradient(135deg, #55baff 0%, #23e6d8 100%);
      border-radius: 20rpx;
      font-size: 36rpx;
      font-weight: 400;
      color: #ffffff;
    }
  }
  .tt-input {
    //#ifdef MP-TOUTIAO
    flex: 1;
    //#endif
  }
</style>
